<template>
  <div class="dict-value">{{ desVal }}</div>
</template>

<script setup name="MerchantStoreDetailServiceConfigDictValue">
  import { inject, computed } from 'vue'
  const props = defineProps({
    val: [String, Number],
    dictProp: String,
  })
  const dict = inject('dict')

  const desVal = computed(() => {
    const val = props.val
    const list = dict?.[props.dictProp]
    if (list) {
      let findResult = list.find((item) => item.value == val)
      if (findResult) {
        return findResult.label
      }
    }
    return '-'
  })
</script>

<style lang="less" scoped>
  .dict-value {
  }
</style>
